package com.tancire.web.controller.app;

import com.tancire.common.core.controller.BaseController;
import com.tancire.common.core.domain.AjaxResult;
import com.tancire.system.domain.SysAddressLibrary;
import com.tancire.system.service.ISysAddressLibraryService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 地址管理Controller
 *
 * @author tancire
 * @date 2024-03-02
 */
@RestController
@RequestMapping("/net/app/address/library")
public class SysAddressLibraryAppController extends BaseController {

    @Resource
    private ISysAddressLibraryService sysAddressLibraryService;

    /**
     * 查询地址管理列表
     */
    @GetMapping("/list")
    public AjaxResult list(SysAddressLibrary sysAddressLibrary) {
        List<SysAddressLibrary> list = sysAddressLibraryService.selectSysAddressLibraryList(sysAddressLibrary);
        return AjaxResult.success(list);
    }

    /**
     * 查询地址管理列表
     */
    @GetMapping("/list/cache")
    public AjaxResult listCache() {
        Object list = sysAddressLibraryService.selectAddressByRedis();
        return AjaxResult.success("查询成功", list);
    }


}
